import { BaseModel } from '@/common/base/base.model';
import { Column, Entity } from 'typeorm';

@Entity('RESOURCE', {
  synchronize: false,
}) // 权限资源
export class ResourceModel extends BaseModel {
  @Column({
    comment: '名称',
    type: 'varchar',
    length: 250,
  })
  name: string;

  @Column({
    comment: '父节点uuid',
    type: 'uuid',
    nullable: true,
  })
  parentUuid?: string;

  @Column({
    comment: '排序',
    type: 'int',
    default: 1,
  })
  sort: number;

  @Column({
    comment: '权限key',
    type: 'varchar',
    length: 50,
  })
  key: string;

}
